/**
 * @Author: zkz
 * @CreateTime: 2025-09-15 16:23:59
 * @Description: 权限路由组件
 */
import {getToken} from "@/utils/token";
import {Navigate } from "react-router-dom";

//高阶组件 有token正常跳转  无token跳转登录页面
export function AuthRoute({children}) {
    const token = getToken();
    return token ?<>{children}</> : <Navigate to="/login" replace/>;
}
